package com.lixinlei.tech.random.split;

import java.util.Random;

public class SplitDemo {

    public static void main(String[] args) {
        String str = "111,222,333,444";
        String[] arr = str.split(",");
        for (String s : arr) {
            System.out.println(s);
        }

        Random random = new Random();
        for(int i = 0; i < 10; i++) {
            System.out.println(arr[random.nextInt(arr.length)]);
        }
    }

}
